#include "wap.h"
#include "wa_gui.h"
#include "wa_tick.h"
#include "wa_ssd1306_spi_drv.h"
#include "wa_keys_drv.h"
#include "wa_uart_drv.h"
#include "wa_screen.h"
#include "wap_main.h"
#include "wap_menu.h"
#include "wap_label.h"
#include "wap_img.h"
#include "wap_checkbox.h"
#include "wap_processbar.h"
#include "wap_roller.h"
#include "wap_slider.h"
#include "wap_cursor.h"
#include "wap_imgbtn.h"
#include "wap_iconlist.h"
#include "wap_editline.h"
#include "wap_messagebox.h"
#include "wap_animation.h"
#include "wap_chinese.h"


void wap_init(void)
{
	wa_init();
	wa_ssd1306_spi_drv_init();
	wa_keys_drv_init();
	wa_uart_drv_init();
	
	wa_screen_add(&wap_main_screen);
	wap_main_init();
	
	wa_screen_add(&wap_menu_screen);
	wap_menu_init();
	
	wa_screen_add(&wap_label_screen);
	wap_label_init();
	
	wa_screen_add(&wap_img_screen);
	wap_img_init();
	
	wa_screen_add(&wap_checkbox_screen);
	wap_checkbox_init();
	
	wa_screen_add(&wap_processbar_screen);
	wap_processbar_init();
	
	wa_screen_add(&wap_roller_screen);
	wap_roller_init();
	
	wa_screen_add(&wap_slider_screen);
	wap_slider_init();
	
	wa_screen_add(&wap_cursor_screen);
	wap_cursor_init();
	
	wa_screen_add(&wap_imgbtn_screen);
	wap_imgbtn_init();
	
	wa_screen_add(&wap_iconlist_screen);
	wap_iconlist_init();
	
	wa_screen_add(&wap_editline_screen);
	wap_editline_init();
	
	wa_screen_add(&wap_messagebox_screen);
	wa_screen_add(&wap_messagebox_ms_screen);
	wap_messagebox_init();
	
	wa_screen_add(&wap_animation_screen);
	wap_animation_init();
	
	wa_screen_add(&wap_chinese_screen);
	wap_chinese_init();
	
	wa_screen_goto_homepage(WAP_WIN_MAIN_ID);
}

void wagui_task(void)
{
	wa_exec();
}

void wagui_input_task(void)
{
	wa_keys_drv_loop();
	wa_uart_drv_loop();
}

void wagui_tick_task(void)
{
	wa_tick_inc(10);
}
